package com.utils;

/**
 * Created by 淡漠Vip on 2018/1/9.
 * Email: itdreamlmc@163.com
 */
public class CoordinateBean {

    /**
     * 起始X
     */
    private Integer startX;

    /**
     * 结束x
     */
    private Integer endX;

    /**
     * Y
     */
    private Integer y;

    private Integer sub;


    public CoordinateBean(Integer y) {
        this.y = y;
    }

    public Integer getStartX() {
        return startX;
    }

    public void setStartX(Integer startX) {
        this.startX = startX;
    }

    public Integer getEndX() {
        return endX;
    }

    public void setEndX(Integer endX) {
        this.sub = endX - this.startX;
        this.endX = endX;
    }

    public Integer getY() {
        return y;
    }

    public void setY(Integer y) {
        this.y = y;
    }

    public Integer getSub() {
        return sub;
    }

    public void setSub(Integer sub) {
        this.sub = sub;
    }

    public boolean isNotNull() {
        if (this.sub != null && this.startX != null && this.endX != null)
            return true;
        else
            return false;
    }

    @Override
    public String toString() {
        return "CoordinateBean{" +
                "startX=" + startX +
                ", endX=" + endX +
                ", y=" + y +
                ", sub=" + sub +
                '}';
    }
}
